package com.example.chapp.listutil;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.chapp.R;

import java.util.List;

public class c3list extends BaseAdapter {
    private List<String> data;
    private Context context;

    public c3list(List<String> data, Context context) {
        this.data = data;
        this.context = context;
    }

    public c3list() {
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int i) {
        return data.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @SuppressLint("ViewHolder")
    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        if (view == null) {
            view = LayoutInflater.from(context).inflate(R.layout.course3list, viewGroup, false);

        }
        TextView textView = view.findViewById(R.id.c3dAata);
        textView.setText(data.get(i));
        return view;
    }
}
